home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’93 / String Extractor⁄Localization / README next >
Encoding:
Text File  |  1993-06-19  |  1.6 KB  |  9 lines  |  [TEXT/MSWD]

  1. String Extractor v1.0 1993-06-18 ©1993 Jon Wätte
  2. This application will go through a folder full of .c, .cp or .cpp sources, and extract all C string literals (including “\P” pascal-style ones) and replace them with calls that read the strings in from resources.
  3. The code makes some assumptions about what C programs look like; don’t handle strings outside of functions well and does not know anything about the preprocessor (except to ignore lines starting with #) It generates Rez source that you can compile using MPW or Think C Rez.
  4. Due to an unfortunate design decision, MPW in its infinite wisdom doesn’t treat \r and \n like the rest of the world; if you do this on MPW source you should re-compile the program (source is included) The actual program that goes with the source ran on itself before I built it, by the way, but that’s the amount of testing this thing has gotten so far. (Unfortunately I lost the original, tested version)
  5. There is an initialization call in the “library” file (which you will have to add to your program) to make it read in all strings; this is good for performance, PowerBooks (which can spin down the disk) or programs that keep references to string literals around. A bonus is that you save up tons of global data space, and reading in all strings will not take up more space than having it as global/static data.
  6. A newer version might use the ID embedded at the bottom of the source file for further processing of the same source file; for now, make sure that each file is always processed once and that IDs are contiguous.
  7. Good luck; I can be reached as h+@nada.kth.se or AppleLink SW1226.
  8.  
  9.